#ifndef __TESTANGLE_H
#define __TESTANGLE_H

#include "sys.h"
#include "mc_math.h"
void init_test_angle(void);
void push_new_bian_angle(int16_t ag);
void push_new_dian_angle(int16_t ag);
int16_t get_test_angle_value(int16_t id);
int16_t get_max_angle(int16_t ag);
void get_shudu(void);
int32_t getcha(void);
//void calculate_cur(void);
int16_t get_cur_set(void);
//void limit_int16(int16_t* value, uint16_t max_value);
//float PI_vt(float current, float step, float kp, float ki);
//void limita(float* value, float max_value);
int16_t control_cur(qd_t *cur_dq,int16_t set);
qd_t Ycontrol_cur(qd_t *cur_dq);
int16_t get_cur_mod(void);
int16_t get_cur_target(void);
int16_t get_target_cur(void);
int16_t convert_rmp_bian(int16_t ab);
int16_t convert_bian_rmp(void);
//int16_t update_cur(int16_t cur,int16_t value);
void ccpi_ct(void);
int16_t Ycur_pid(qd_t *cur_dq) ;
int16_t get_juedui_bianma(void);
void clear_juedui_bianma(void);
int16_t get_bianma_zero(void);
int16_t test_bbmm(void);
int16_t get_run_mode(void);
int16_t seat_mode(void);
float sp_ct_just(int16_t current_speed,int16_t target_speed);
void init_speed(void);
int16_t quchu_piao(int16_t b_new);
void paixu_angle(void);
void set_run_mode(int16_t m);
int16_t get_speed_angle_shift(void) ;
void run_can(void);
int16_t get_can_speed(void);
void process_uart1(uint8_t *data,int16_t len);
void lun_control_uart1(uint8_t *data,int16_t len);

///test//
void set_old_uangle(int16_t ag);
int16_t get_ag_flag_temp(void);
void set_err(int16_t er);
int16_t get_err(void);
void add_err(void);
//////mode 1
void init_mode1(void);
int16_t get_m1_cur_angle(int16_t ag);
#endif